package com.spr.utils;

import java.lang.reflect.Array;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
import java.util.stream.Stream;

public class MapUtils {
    public  static Map<String,Object> generatorMap(Object... objects){
        Map map =new HashMap();
        if (objects.length==0){
            return map;
        }

        Object[] objects1 = Arrays.copyOf(objects, objects.length + 1);
        if (objects.length%2!=0) {
            objects1[objects.length] = null;
        }
        for (int i = 0; i < objects1.length / 2; i++) {
            map.put(objects1[2*i],objects1[2*i+1]);
        }
        return map;
    }





}
